/**
* <p> title �� ProcessServiceImpl.java</p>
* <p> package �� cn.edu.hit.education.service</p>
* <p> description ��TODO</p>
* <p> copyright �� ��������ҵ��ѧ(C) 2019</p>
* <p> company �� ��������ҵ��ѧAS&MT</p>
* <p> author �� ��ѩ�� jinxuesong@163.com</p>
* <p> date �� 2021��4��21�� ����4:38:37</p>
* <p> version �� v1.0 </p>
*
* Modification  History:
* Date         Author        Version        Discription
* -----------------------------------------------------------------------------------
* 2021��4��21��       ��ѩ��          1.0             1.0
* Why & What is modified: <�޸�ԭ������>
*/
package cn.edu.hit.education.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.hit.education.dao.ProcessMapper;
import cn.edu.hit.education.pojo.Process;
import cn.edu.hit.education.pojo.ProcessExample;

@Service
public class ProcessServiceImpl implements IProcessService {

	@Autowired
	ProcessMapper processMapper;

	@Override
	public int insert(Process process) {
		return processMapper.insert(process);
	}

	@Override
	public int deleteByPrimaryKey(int id) {
		return processMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int update(Process process) {
		return processMapper.updateByPrimaryKey(process);
	}

	@Override
	public List<Process> queryAllProcess() {
		ProcessExample example = new ProcessExample();
		ProcessExample.Criteria criteria = example.createCriteria();
		criteria.andIdGreaterThan(0);
		
		return processMapper.selectByExample(example);
	}

	@Override
	public List<Process> queryProcessesByProcessName(String name) {
		ProcessExample example = new ProcessExample();
		ProcessExample.Criteria criteria = example.createCriteria();
		criteria.andNameEqualTo(name.trim());
		
		return processMapper.selectByExample(example);
	}

	@Override
	public Process queryProcessByPrimaryKey(int id) {
		// TODO 自动生成的方法存根
		return processMapper.selectByPrimaryKey(id);
	}

}
